package shopCart;

import domain.Item;

public class CartItem {

	/**
	 * @param args
	 */
	private Item item;
	private int qty;
	
	public double getTotalPrice(){
		if(item != null){
			double p = Double.parseDouble(item.getListprice());
			return p*qty;
		}else{
			return 0;
		}
	}
	
	public void updateQty(int qty){
		setQty(qty);
	}

	public Item getItem() {
		return item;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	public int getQty() {
		return qty;
	}

	public void setQty(int qty) {
		this.qty = qty;
	}
	
}
